﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using cms.libs;

namespace CMS
{
    public partial class ReportDoanhThu : System.Web.UI.Page
    {
        private DataTable lstDt = null;
        public string SUM1 = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtFromDate.SelectedDate = DateTime.Now.AddMonths(-1);
                txtToDate.SelectedDate = DateTime.Now;
                BindData();
            }
        }
        protected void BindData()
        {
            DateTime fromD = txtFromDate.SelectedDate.Value;
            DateTime toD = txtToDate.SelectedDate.Value;

            

            lstDt = new DBIncome().GetListDataTable(fromD, toD);

            GridView1.DataSource = lstDt;
            GridView1.DataBind();

          
        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            BindData();
        }
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            BindData();
        }
    }
}